class ResultModel<T> {
  late T data;
  late int code;
  late String msg;
  bool isSuccess = false;

  ResultModel(this.data, this.code, this.msg, this.isSuccess);

  ResultModel.fromJson(Map<String, dynamic> json) {
    data = json['data'];
    code = json['code'];
    msg = json['msg'];
    isSuccess = json['isSuccess'] ?? false;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['data'] = this.data;
    data['code'] = this.code;
    data['msg'] = this.msg;
    data['isSuccess'] = this.isSuccess;
    return data;
  }
}

class ListResultModel<T> {
  late List<T> data;
  late int code;
  late String msg;

  ListResultModel(this.data, this.code, this.msg);

  ListResultModel.fromJson(Map<String, dynamic> json) {
    data = json['data'];
    code = json['code'];
    msg = json['msg'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['data'] = this.data;
    data['code'] = this.code;
    data['msg'] = this.msg;
    return data;
  }
}
